from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles
from starlette.responses import JSONResponse, PlainTextResponse
import router.book_api as book_router

app=FastAPI()
# app.mount("/", StaticFiles(directory="web"), name="static")
# @app.get('/',response_class=PlainTextResponse)
# def index():
#     return 'hello'

app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

app.include_router(book_router.router)
    


if __name__ == '__main__':
    import uvicorn
    uvicorn.run(app,port=9999)